+2004-09-29 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkdialog.c (gtk_dialog_map): Skip selectable labels when
+ looking for the initial focus widget.
+
+ * gtk/gtklabel.c (gtk_label_focus): Remove to put selectable labels
+ in the regular focus chain again.
+
2004-09-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render): Don't
+2004-09-29 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkdialog.c (gtk_dialog_map): Skip selectable labels when
+ looking for the initial focus widget.
+
+ * gtk/gtklabel.c (gtk_label_focus): Remove to put selectable labels
+ in the regular focus chain again.
+
2004-09-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render): Don't
+2004-09-29 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkdialog.c (gtk_dialog_map): Skip selectable labels when
+ looking for the initial focus widget.
+
+ * gtk/gtklabel.c (gtk_label_focus): Remove to put selectable labels
+ in the regular focus chain again.
+
2004-09-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render): Don't
+2004-09-29 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkdialog.c (gtk_dialog_map): Skip selectable labels when
+ looking for the initial focus widget.
+
+ * gtk/gtklabel.c (gtk_label_focus): Remove to put selectable labels
+ in the regular focus chain again.
+
2004-09-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render): Don't
#include "gtkbutton.h"
#include "gtkdialog.h"
#include "gtkhbbox.h"
+#include "gtklabel.h"
#include "gtkhseparator.h"
#include "gtkmarshalers.h"
#include "gtkvbox.h"
* widget in the tab chain, but if this results in the focus
* ending up on one of the response widgets _other_ than the
* default response, we focus the default response instead.
+ *
+ * Additionally, skip selectable labels when looking for the
+ * right initial focus widget.
*/
static void
gtk_dialog_map (GtkWidget *widget)
{
GList *children, *tmp_list;
- g_signal_emit_by_name (window, "move_focus", GTK_DIR_TAB_FORWARD);
+ do
+ {
+ g_signal_emit_by_name (window, "move_focus", GTK_DIR_TAB_FORWARD);
+ }
+ while (GTK_IS_LABEL (window->focus_widget));
tmp_list = children = gtk_container_get_children (GTK_CONTAINER (dialog->action_area));
{
GtkWidget *child = tmp_list->data;
- if (child == window->focus_widget && child != window->default_widget && window->default_widget)
+ if (window->focus_widget == NULL ||
+ (child == window->focus_widget &&
+ child != window->default_widget &&
+ window->default_widget))
{
gtk_widget_grab_focus (window->default_widget);
break;
gboolean group_cycling);
static void gtk_label_setup_mnemonic (GtkLabel *label,
guint last_key);
-static gboolean gtk_label_focus (GtkWidget *widget,
- GtkDirectionType direction);
/* For selectable lables: */
static void gtk_label_move_cursor (GtkLabel *label,
widget_class->hierarchy_changed = gtk_label_hierarchy_changed;
widget_class->screen_changed = gtk_label_screen_changed;
widget_class->mnemonic_activate = gtk_label_mnemonic_activate;
- widget_class->focus = gtk_label_focus;
class->move_cursor = gtk_label_move_cursor;
class->copy_clipboard = gtk_label_copy_clipboard;
return label->use_underline;
}
-static gboolean
-gtk_label_focus (GtkWidget *widget,
- GtkDirectionType direction)
-{
- GtkLabel *label = GTK_LABEL (widget);
- GdkEvent *current_event;
- gboolean is_control_tab = FALSE;
-
- /* We want to be in the tab chain only if we are selectable
- * and Control-[Shift]Tab is pressed
- */
- if (label->select_info == NULL)
- return FALSE;
-
- current_event = gtk_get_current_event ();
-
- if (current_event)
- {
- if (current_event->type == GDK_KEY_PRESS &&
- (current_event->key.keyval == GDK_Tab ||
- current_event->key.keyval == GDK_KP_Tab ||
- current_event->key.keyval == GDK_ISO_Left_Tab) &&
- (current_event->key.state & GDK_CONTROL_MASK) != 0)
- is_control_tab = TRUE;
-
- gdk_event_free (current_event);
- }
-
- if (is_control_tab)
- return GTK_WIDGET_CLASS (parent_class)->focus (widget, direction);
- else
- return FALSE;
-}
-
/* Compute the X position for an offset that corresponds to the "more important
* cursor position for that offset. We use this when trying to guess to which
* end of the selection we should go to when the user hits the left or